package org.baicaixiaozhan.springbootwebdemo2.controller;

import lombok.AllArgsConstructor;
import org.baicaixiaozhan.springbootwebdemo2.util.ResultTemplate;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * DESC:
 *
 * @author : baicaixiaozhan
 * @since : 2021-02-07
 */
@RestController
@RequestMapping("/security")
@AllArgsConstructor
public class IndexController {

    @GetMapping("/index")
    @PreAuthorize("hasRole('ADMIN')")
    public ResultTemplate<Object> index() {
        return ResultTemplate.success();
    }
}
